package smb;

import static org.junit.Assert.assertEquals;

import robocode.BattleResults;
import robocode.control.events.BattleCompletedEvent;
import robocode.control.testing.RobotTestBed;

/**
 * Tests that PwnU2 kills sitting duck 100%
 * edited from professor johnson code.
 * @author Shoji Bravo
 * 
 */
public class TestPwnUVsSittingDuck extends RobotTestBed {
 /**
  * Specifies that SittingDuck and PwnU2 are to be matched up in this test case.
  * 
  * @return The comma-delimited list of robots in this match.
  */
 @Override
 public String getRobotNames() {
  return "sample.SittingDuck,smb.PwnU2";
 }

 /**
  * This test runs for 1 round.
  * 
  * @return The number of rounds.
  */
 @Override
 public int getNumRounds() {
  return 10;
 }

 /**
  * After the battle, check to see that we've visited the corners.
  * 
  * @param event
  *         Details about the completed battle.
  */
 @Override
 public void onBattleCompleted(BattleCompletedEvent event) {
  // Return the results in order of getRobotNames.
  BattleResults[] Results = event.getIndexedResults();
   BattleResults PwnU = Results[1];
  String robotName = PwnU.getTeamLeaderName();
  assertEquals("Check " + robotName + " is winner", PwnU.getFirsts(), getNumRounds());
  System.out.println(robotName + " won " + PwnU.getFirsts());
 }

}
